package com.ztgf.commodity.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.commodity.models.bo.CommodityEvaluationBO;
import com.ztgf.commodity.models.bo.CommodityEvaluationManageBO;
import com.ztgf.commodity.models.dto.CommodityEvaluationDTO;
import com.ztgf.commodity.models.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品评价表映射
 *
 * @author chenyu.wang
 * @Date 2020-05-29 15:18:55
 */
@Mapper
public interface CommodityEvaluationMapper extends BaseMapper<CommodityEvaluationDTO> {

    /**
     * description:根据商品id统计该商品评论数量
     * param: [id]
     * author: chenyu.wang
     * date: 2020-05-29
     * return: java.lang.Integer
     */
    Integer getCommentsNumber(@Param("id") Long id);

    /**
     * description: 商城商品评价页列表
     * param: []
     * author: chenyu.wang
     * date: 2020-05-29
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityEvaluationPageVO>
     */
    List<CommodityEvaluationPageVO> queryEvaluationList(Page<CommodityEvaluationPageVO> page, @Param("item") CommodityEvaluationBO bo);

    /**
     * description: 根据父级id查询下级评价列表
     * param: [parentId]
     * author: chenyu.wang
     * date: 2020-07-03
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityEvaluationPageVO>
     */
    List<CommodityEvaluationPageVO> getByParentId(@Param("parentId") Long parentId);

    /**
     * description: 评价管理列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-03
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityEvaluationManageVO>
     */
    List<CommodityEvaluationManageVO> queryEvaluationManageList(Page<CommodityEvaluationManageVO> page, @Param("item") CommodityEvaluationManageBO bo);

    /**
     * description: 查看评价详情
     * param: [id]
     * author: chenyu.wang
     * date: 2020-07-03
     * return: com.ztgf.commodity.models.vo.CommodityEvaluationPageVO
     */
    CommodityEvaluationPageVO getViewEvaluationById(@Param("id") Long id);

    /**
     * description: 查询店铺信息页产品评价列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-24
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopPageEvaluationVO>
     */
    List<CommodityShopPageEvaluationVO> queryShopPageEvaluation(Page<CommodityShopPageEvaluationVO> page, @Param("item") CommodityEvaluationManageBO bo);

    /*
     * @description:获取发起评价页左侧商品订单信息
     * @author: chenyu.wang
     * @date: 2020-08-19
     */
    CommodityEvaluationOneVO queryLeftOrderMsg(@Param("id") Long id);

    /*
     * @description:商城商品评价页，店铺全部评价列表
     * @author: chenyu.wang
     * @date: 2020-08-21
     */
    List<CommodityEvaluationTwoVO> queryShopAllEvaluation(@Param("shopId") Long shopId);

    /*
     * @description:商城商品评价页头部数据
     * @author: chenyu.wang
     * @date: 2020-08-21
     */
    CommodityEvaluationThreeVO queryGoodsEvaluationHeader(@Param("goodsId") Long goodsId);

    /*
     * @description:获取各标签评价的数量
     * @author: chenyu.wang
     * @date: 2020-08-21
     */
    Integer queryLabelNum(@Param("labelName") String labelName, @Param("goodsId") Long goodsId);

    CommodityEvaluationThreeVO getGoodsMsgById(@Param("goodsId") Long goodsId);
}
